package com.yhl.log.entity;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
* @author YaoHongli
* @since 2023-08-07 16:31:26
*/
@Data
//@TableName(value = "goods_bill",autoResultMap = true)
public class GoodsBill {
    private Integer id;

//    @TableField(value = "goods",typeHandler = JacksonTypeHandler.class)
    private Goods goods;

//    @TableField(value = "user_message",typeHandler = JacksonTypeHandler.class)
    private UserMessage userMessage;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date purchaseTime;

    public static class UserMessage {

        private String address;
        @JsonProperty("userName")
        private String userName;
        @JsonProperty("userNumber")
        private String userNumber;

        public String getAddress() {
            return address;
        }

        public void setAddress(String address) {
            this.address = address;
        }

        public String getUserName() {
            return userName;
        }

        public void setUserName(String userName) {
            this.userName = userName;
        }

        public String getUserNumber() {
            return userNumber;
        }

        public void setUserNumber(String userNumber) {
            this.userNumber = userNumber;
        }


    }

    public static class Goods{
        @JsonProperty("goodsId")
        private String goodsId;
        @JsonProperty("goodsName")
        private String goodsName;

        private String price;

        public String getGoodsId() {
            return goodsId;
        }

        public void setGoodsId(String goodsId) {
            this.goodsId = goodsId;
        }

        public String getGoodsName() {
            return goodsName;
        }

        public void setGoodsName(String goodsName) {
            this.goodsName = goodsName;
        }

        public String getPrice() {
            return price;
        }

        public void setPrice(String price) {
            this.price = price;
        }
    }


}
